package com.yupi.yupao.model.enums;

/**
 * @author 曹宏福
 * @version 1.0
 */
public enum TeamStatusEnum {

    /**
     * 定义枚举类型
     */
    //公开
    PUBLIC(0, "公开"),
    //私有
    PRIVATE(1, "私有"),
    //加密
    SECRET(2, "加密");;

    /**
     * 提供方法:根据Value值获取枚举类型说明
     */
    public static TeamStatusEnum getEnumByValue(Integer value) {
        if (value == null) {
            return null;
        }
        TeamStatusEnum[] values = TeamStatusEnum.values();
        for (TeamStatusEnum teamStatusEnum : values) {
            if (teamStatusEnum.getValue() == value) {
                return teamStatusEnum;
            }
        }
        return null;
    }

    //字段
    private int value;
    private String text;

    /**
     * 构造函数
     */
    TeamStatusEnum(int value, String text) {
        this.value = value;
        this.text = text;
    }

    /**
     * get set 方法
     *
     * @return
     */
    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
}
